//
// Created by PC on 2022/12/21.
//

#include <iostream>
using namespace std;

struct Node{
    int value;
    struct Node *right;
};

void printList(Node *p)
{
    Node *cur = p;
    while (cur)
    {
        printf("%d\n",cur->value);
        cur=cur->right;
    }
}

int main()
{
    Node n1;
    Node n2;
    Node n3;
    n1={1,&n2};
    n2={2,&n3};
    n3={3,NULL};

    Node *head = &n1;
    printList(head);
}